<title>xpm file format</title>
<LINK rel=stylesheet href="style.css" type="text/css">
<BODY text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#650065" alink="#FF0000">
<h2>xpm file format</h2>
<CENTER><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH="98%">
<TR>
<TD><font size=-1><A HREF="../online.html">Main Table of Contents</A></font></TD>
<TD ALIGN=RIGHT><B>VERSION 4.0</B></TR>
<TR><TD><font size=-1><A HREF="http://www.gromacs.org">GROMACS homepage</A></font></TD>
<TD ALIGN=RIGHT><B>Sun 18 Jan 2009</B></TR></TABLE></CENTER><HR>
<H3>Description</H3>
The GROMACS xpm file format is compatible with the XPixMap format
and is used for storing matrix data.
Thus GROMACS xpm files can be viewed directly with programs like XV.
The first matrix data line in an xpm file corresponds to the last matrix
row. 
In addition to the XPixMap format, GROMACS xpm files may contain
extra fields. The information in these fields is used when converting
an xpm file to EPS with 
<A HREF="xpm2ps.html">xpm2ps</a>. 
The optional extra field are:
<ul>
<li>
Before the <tt>gv_xpm</tt> declaration:  <tt>title</tt>, <tt>legend</tt>, 
<tt>x-label</tt>, <tt>y-label</tt> and <tt>type</tt>,
all followed by a string.
The <tt>legend</tt> field determines the legend title.
The <tt>type</tt> field must be followed by <tt>"continuous"</tt> or
<tt>"discrete"</tt>,
this determines which type of legend will be drawn in an EPS file,
the default type is continuous.   
<li>
The xpm colormap entries may be followed by a string, which is a label for
that color.
<li>
Between the colormap and the matrix data, the fields 
<tt>x-axis</tt> and/or <tt>y-axis</tt>
may be present followed by the tick-marks for that axis.
</ul>
The example GROMACS xpm file below contains all the extra fields.
The C-comment delimiters and the colon in the extra fields are optional.   
<pre>
/* XPM */
/* This matrix is generated by g_rms. */
/* title:   "Backbone RMSD matrix" */
/* legend:  "RMSD (nm)" */
/* x-label: "Time (ps)" */
/* y-label: "Time (ps)" */
/* type:    "Continuous" */
static char * gv_xpm[] = {
"13 13   6 1",
"A  c #FFFFFF " /* "0" */,
"B  c #CCCCCC " /* "0.0399" */,
"C  c #999999 " /* "0.0798" */,
"D  c #666666 " /* "0.12" */,
"E  c #333333 " /* "0.16" */,
"F  c #000000 " /* "0.2" */,
/* x-axis:  0 40 80 120 160 200 240 280 320 360 400 440 480 */
/* y-axis:  0 40 80 120 160 200 240 280 320 360 400 440 480 */
"FEDDDDCCCCCBA",
"FEDDDCCCCBBAB",
"FEDDDCCCCBABC",
"FDDDDCCCCABBC",
"EDDCCCCBACCCC",
"EDCCCCBABCCCC",
"EDCCCBABCCCCC",
"EDCCBABCCCCCD",
"EDCCABCCCDDDD",
"ECCACCCCCDDDD",
"ECACCCCCDDDDD",
"DACCDDDDDDEEE",
"ADEEEEEEEFFFF"
</pre>
<hr>
<div ALIGN=RIGHT>
<font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>
</div>
</body>
